From: Steve Capper Date: Thu, 6 Aug 2026 11:30:12 +0000 (+0200) Subject: Remove unaligned mem-accesses from test_malloc_pools.cpp X-Git-Tag: archive/raspbian/2023.1.0-2+rpi1^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d48877531cddf2e325b584e294905087457dbf2b;p=onetbb.git Remove unaligned mem-accesses from test_malloc_pools.cpp Last-Changed: 2017-08-13 Forwarded: no This should help sparc64 tests, if we miss a case a SIGBUS will greet us. Gbp-Pq: Name 1000-remove-unaligned-test.patch --- diff --git a/test/tbbmalloc/test_malloc_pools.cpp b/test/tbbmalloc/test_malloc_pools.cpp index f73c28e..8f83d76 100644 --- a/test/tbbmalloc/test_malloc_pools.cpp +++ b/test/tbbmalloc/test_malloc_pools.cpp @@ -66,11 +66,11 @@ static std::atomic liveRegions; static void *getMallocMem(intptr_t /*pool_id*/, size_t &bytes) { - void *rawPtr = malloc(bytes+sizeof(MallocPoolHeader)+1); + void *rawPtr = malloc(bytes+sizeof(MallocPoolHeader)); if (!rawPtr) return nullptr; // +1 to check working with unaligned space - void *ret = (void *)((uintptr_t)rawPtr+sizeof(MallocPoolHeader)+1); + void *ret = (void *)((uintptr_t)rawPtr+sizeof(MallocPoolHeader)); MallocPoolHeader *hdr = (MallocPoolHeader*)ret-1; hdr->rawPtr = rawPtr;